/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package personal.obj;

/**
 *
 * @author PHATNBSE61057
 */
public class Category {

    private String categoryID;
    private String categoryName;
    private String categoryLink;

    public Category() {
    }

    public Category(String categoryID, String categoryName, String categoryLink, String webPage) {
        this.categoryID = categoryID;
        this.categoryName = categoryName;
        this.categoryLink = categoryLink;
    }

    public Category(String categoryName, String categoryLink, String webPage) {
        this.categoryName = categoryName;
        if (!categoryLink.contains("http")) {
            this.categoryLink = webPage + categoryLink;
        } else {
            this.categoryLink = categoryLink;
        }
    }

    @Override
    public String toString() {
        String result = "Name: " + getCategoryName()
                + "\nLink: " + getCategoryLink();
        return result;
    }

    /**
     * @return the categoryID
     */
    public String getCategoryID() {
        return categoryID;
    }

    /**
     * @param categoryID the categoryID to set
     */
    public void setCategoryID(String categoryID) {
        this.categoryID = categoryID;
    }

    /**
     * @return the categoryName
     */
    public String getCategoryName() {
        return categoryName;
    }

    /**
     * @param categoryName the categoryName to set
     */
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    /**
     * @return the categoryLink
     */
    public String getCategoryLink() {
        return categoryLink;
    }

    /**
     * @param categoryLink the categoryLink to set
     */
    public void setCategoryLink(String categoryLink) {
        this.categoryLink = categoryLink;
    }
}
